<%@ include file="/header.jsp" %>

<h1>Users</h1>

<c:if test="${not empty sessionScope._user && sessionScope._user.isAdmin eq 'Y'}">
	<table border="1" width="90%" cellspacing="0" style="margin:10px">
	<col width="5%" /><col width="75%" /><col width="10%" /><col width="10%" />
	    <thead>
	        <tr>
	            <td><b>Id</b></td>
	            <td><b>Login</b></td>
	            <td><b>Is Admin</b></td>
	            <td><b>Password</b></td>
	        </tr>
	    </thead>
	    <tbody>
	        <c:forEach var="user" items="${list}">
	            <tr>
	            <td>
	            	<c:out value="${user.userId}" />
	            </td>
	            <td>
	                <c:out value="${user.userName}"/>
	            </td>
	            <td>
	            	<a href="/lab02-music-portal/music/grant_revoke?id=${user.userId}"> 
					<c:out value="${user.isAdmin}"/>
	            	</a>
	            </td>
	            <td>
	            	<a href="/lab02-music-portal/music/change_password?id=${user.userId}">Change</a>
	            </td>
	            </tr>
	        </c:forEach>
	    </tbody>
	</table>
</c:if>

<%@ include file="/footer.jsp" %>
</html>
